package com.example.server.command.client;

import java.sql.SQLException;
import java.util.Map;

import javax.naming.NamingException;

import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;

import com.example.server.ErrorConst;
import com.example.server.command.AbstractCommand;
import com.example.server.db.DBManager;
import com.example.server.message.ResultMessage;

public class LoginCommand extends AbstractCommand {

	private final static Logger log = Log.getLogger(LoginCommand.class);

	@Override
	public void doHander() {
		try {
			Map<String, Object> a = DBManager.getInstance().findSimpleResult("select * from ci_sessions", null);
			ResultMessage rm = getResultMessage(ErrorConst.VALIDATE_PARAMETER, a);
			writeToJson(rm);
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
